package com.georgehu;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by hu on 2017-08-01.
 */
@Controller
public class HelloController {

    @RequestMapping(value = {"/", ""})
    public String home() {
        return "/hello.html";
    }

    @RequestMapping("hello/crosPost")
    @ResponseBody
    public String crosPost(String a, String largeData) {
        return "('hello " + a + "\r\n,largeData:" + largeData + "')";
    }

    @RequestMapping("hello/jsonpGet")
    @ResponseBody
    public String jsonpGet(String a, String largeData, String callback) {
        return callback + "('hello " + a + ",largeData:" + largeData + "')";
    }
}
